<?php

/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Sitealbum
 * @copyright  Copyright 2010-2011 BigStep Technologies Pvt. Ltd.
 * @license    http://www.socialengineaddons.com/license/
 * @version    $Id: index.tpl 2011-08-026 9:40:21Z SocialEngineAddOns $
 * @author     SocialEngineAddOns
 */
?>
<?php 
	$this->headLink()
  ->appendStylesheet($this->layout()->staticBaseUrl
    . 'application/modules/Sitealbum/externals/styles/style_sitealbum.css')
?>
<?php
$photoSettings=  array();
$photoSettings['class'] = 'thumb';
if($this->showLightBox):
include_once APPLICATION_PATH . '/application/modules/Sitealbum/views/scripts/_lightboxPhoto.tpl';
endif;
$i=0;
?>
<ul class="generic_list_widget generic_list_widget_large_photo">
  <?php foreach( $this->paginator as $item ): ?>
  <?php if($this->showLightBox):
  $photoSettings["onclick"]="openLightBoxAlbum('".$item->getPhotoUrl()."','".Engine_Api::_()->sitealbum()->getLightBoxPhotoHref($item,array_merge($this->params, array('offset'=>$i)))."');return false;";
  endif; ?>
    <li>
      <div class="photo">
        <?php echo $this->htmlLink($item->getHref(), $this->itemPhoto($item, 'thumb.normal'), $photoSettings) ?>
      </div>
      <div class="info">
        <div class="title">
          <?php echo $this->htmlLink($item->getHref(), $this->string()->truncate($item->getTitle(), 13)) ?>
        </div>
        <div class="stats">
          <?php if( $this->popularType == 'view' ): ?>
            <?php echo $this->translate(array('%s view', '%s views', $item->view_count), $this->locale()->toNumber($item->view_count)) ?>
          <?php elseif( $this->popularType == 'comment' ): ?>
            <?php echo $this->translate(array('%s comment', '%s comments', $item->comment_count), $this->locale()->toNumber($item->comment_count)) ?>
         <?php elseif( $this->popularType == 'like' ): ?>
           <?php echo $this->translate(array('%s like', '%s likes', $item->like_count), $this->locale()->toNumber($item->like_count)) ?>
         <?php endif; ?>        
        </div>
        <div class="owner">
          <?php
            $owner = $item->getOwner();
            $parent = $item->getParent();
            echo $this->translate('By %1$s in %2$s',
                $this->htmlLink($owner->getHref(), $owner->getTitle()),
                $this->htmlLink($parent->getHref(), $parent->getTitle()));
          ?>
        </div>
      </div>
    </li>
   <?php $i++;?>
  <?php endforeach; ?>
</ul>